﻿//自动义双击方法
function CustomDbClick() {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    window.parent.$("#tabs").tabs('close', '查看产品包');
    var pagetitle = "查看产品包";
    parent.addTabs('查看产品包', '../Crm/Hodometer/ProductPack.aspx?flag=1&r=' + Math.random() + '&title=' + encodeURI(pagetitle) + '&entity=CrmProductPack&id=' + record.getData(const_entityID));
    parent.NeedRefreshPage = this;
}
//自定义新增方法
var fnCustomAdd = function () {
    window.parent.$("#tabs").tabs('close', '新增产品包');
    var pagetitle = "新增产品包";
    parent.addTabs(pagetitle, '../Crm/Hodometer/ProductPack.aspx?flag=0&title=' + encodeURI(pagetitle) + '');
    parent.NeedRefreshPage = this;
}
//自定义修改方法
var fnCustomEdit = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    window.parent.$("#tabs").tabs('close', '编辑产品包');
    var pagetitle = "编辑产品包";
    parent.addTabs('编辑产品包', '../Crm/Hodometer/ProductPack.aspx?flag=2&r=' + Math.random() + '&title=' + encodeURI(pagetitle) + '&entity=CrmProductPack&id=' + record.getData(const_entityID));
    parent.NeedRefreshPage = this;
}